import 'package:flutter/foundation.dart';
import 'package:flutter/services.dart';

import 'flutter_text_reader_platform_interface.dart';

/// An implementation of [FlutterTextReaderPlatform] that uses method channels.
class MethodChannelFlutterTextReader extends FlutterTextReaderPlatform {
  /// The method channel used to interact with the native platform.
  @visibleForTesting
  final methodChannel = const MethodChannel('com.maiyuren.sudict/fluttertextreader');

  @override
  Future<String?> getPlatformVersion() async {
    final version = await methodChannel.invokeMethod<String>('getPlatformVersion');
    return version;
  }

  @override
  Future<void> load(String path, bool isHor) async {
    await methodChannel.invokeMethod('load', {
      "path": path,
      "isHor": isHor
    });
    return;
  }
}
